<!DOCTYPE HTML>
<html>
<head>
    {include file='common_header'}
    <title>优惠券列表</title>
    <link rel="stylesheet" type="text/css" href="__ACSS__switch-buttons.css">
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商户管理 <span class="c-gray en">&gt;</span> 优惠券列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            <a href="javascript:;" onclick="layer_show('添加优惠券','{:url('showadd')}','800','600')" class="btn btn-primary radius">
                <i class="Hui-iconfont">&#xe600;</i> 添加优惠券
            </a>
        </span>
        <div style="float: right">
            优惠券开始时间范围：<input type="text" onfocus="WdatePicker()" value="{$begin}" placeholder="申请开始时间" id="begin" class="input-text Wdate" style="width:150px;">
            --
            <input type="text" onfocus="WdatePicker()"  value="{$end}" placeholder="申请开始时间" id="end"  class="input-text Wdate" style="width:150px;">
            优惠券结束时间范围：<input type="text" onfocus="WdatePicker()" value="{$begins}" placeholder="申请结束时间" id="begins" class="input-text Wdate" style="width:150px;">
            --
            <input type="text" onfocus="WdatePicker()"  value="{$ends}" placeholder="申请结束时间" id="ends"  class="input-text Wdate" style="width:150px;">
            <input type="text" class="input-text" style="width:250px" placeholder="请输入优惠券名称" id="keyword" value="{$Think.get.keyword}">
            <button type="button" class="btn btn-success" onclick="reload()"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
        </div>
        <table class="table table-border table-bordered table-hover table-bg">
            <thead>
            <tr>
                <th scope="col" colspan="12">优惠券列表</th>
            </tr>
            <tr class="text-c">
                <th width="80">ID</th>
                <th width="80">优惠券名称</th>
                <th width="80">价格(元)</th>
                <!--<th width="80">满减价格(元)</th>-->
                <th width="50">总数量</th>
                <th width="50">剩余数量</th>
                <th width="50">描述</th>
                <th width="100">优惠券时间</th>
                <th width="50">优惠券状态</th>
                <th width="80">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="$list" id="v"}
            <tr class="text-c">
                <td>{$v->id}</td>
                <td>{$v->name}</td>
                <td>{$v->price}</td>
                <!--<td>{$v->mjprice}</td>-->
                <td>{$v->num}</td>
                <td>{$v->sup_num}</td>
                <td>{$v->content}</td>
                <td>{$v->starttime|date='Y-m-d',###}   <span style="color: #5A98DE;">--至--</span>{$v->endtime|date='Y-m-d',###}</td>
                <td >
                    {if condition="$v->d_status eq 1"}
                    <span class="	btn btn-success radius" >正常</span>
                    {else /}
                    <span class="btn btn-danger radius" >已过期</span>
                    {/if}
                </td>
                <td>
                    <a title="编辑" href="javascript:;" onclick="layer_show('商户编辑','{:url('showEdit',array('id'=>$v['id']))}','800','600')" class="btn btn-warning  radius" style="text-decoration:none">
                        <i class="Hui-iconfont">&#xe6df;</i>
                    </a>
                    <!--<a title="删除" href="javascript:;" onclick="delectOne('{:url('del',array('id'=>$v['id']))}',this)" class="btn btn-danger radius" >
                        <i class="Hui-iconfont">&#xe6e2;</i>
                    </a>-->
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
        <div class="page">
            {$page}
        </div>
    </div>
    <!--_footer 作为公共模版分离出去-->
    {include file='common_footer'}
    <!--/_footer 作为公共模版分离出去-->
</div>
</body>
<script>
    function reload() {
        var obj =$('#keyword').val();
        var begintime =$('#begin').val();
        var endtime =$('#end').val();
        var begintimes =$('#begins').val();
        var endtimes =$('#ends').val();
        goUrl('?keyword=' + obj+"&begin="+begintime+"&end="+endtime+'&begins='+begintimes+'&ends='+endtimes);
    }
</script>
</html>